package br.com.scitv.tela;

import java.awt.event.KeyEvent;

import br.com.scitv.SCITV;

import com.sun.dtv.lwuit.Form;
import com.sun.dtv.lwuit.Image;
import com.sun.dtv.lwuit.Label;
import com.sun.dtv.lwuit.geom.Dimension;
import com.sun.dtv.ui.event.RemoteControlEvent;
import com.sun.dtv.ui.event.UserInputEvent;

public class TelaFim extends Tela{

	private Label carrinho;
//	private Button comprar;
//	private Label informacao;
	private Form form;
	
	
	public TelaFim(){
		form = new Form();
	}
	

	public void userInputEventReceived(UserInputEvent inputEvent) {			
		com.sun.dtv.ui.event.KeyEvent event = (com.sun.dtv.ui.event.KeyEvent) inputEvent;

		if(event.getID() == KeyEvent.KEY_RELEASED){
			return;
		}

		switch(event.getKeyCode()){
		case RemoteControlEvent.VK_COLORED_KEY_0: 
			break;
		}

//		form.repaint();		
	}

	public void addComponentes(){
		int borda = 50;
		dtvcontainer.addComponent(form);
		
		carrinho = new Label();
		Image image = null;
		try {
			image = Image.createImage(SCITV.BASEDIR + SCITV.getPropiedadePathImagem("img.fim"));
			carrinho.setIcon(image);
		} catch (Exception e) {		
			System.out.println("Error while loading image " +  e.getMessage());
		}

		carrinho.setX( 10 );
		carrinho.setY( 10 );
		carrinho.setSize( new Dimension( image.getWidth(), image.getHeight()  ));

		/*comprar = new Button();
		comprar.setText(SCITV.getPropiedade("texto.comprar"));	
		comprar.setY(fundo.getAbsoluteY()+30);
		comprar.setX(fundo.getAbsoluteX()+fundo.getWidth() - 56 );
		
		informacao = new Label();
		informacao.setText(SCITV.getPropiedade("texto.informacao"));
		informacao.setX(fundo.getX());
		informacao.setY(fundo.getY()-10);*/
		
		form.addComponent(carrinho);
//		form.addComponent(comprar);
//		form.addComponent(informacao);
		
		form.repaint();
	}

}
